alter table "PackageModule"
add column "Complimentary" numeric(8,2),
 add column   "Exclusions" character varying(1000) ;

------------------------------------------------------------------------------------------------------------------------------

create sequence "DoctorSpecializationChargeModuleCategory_DoctorSpecializationChargeModuleCategoryId_seq"

---------------------------------------------------------------------------------------------------------------------------

-- Table: public.DoctorSpecializationChargeModuleCategory

-- DROP TABLE IF EXISTS public."DoctorSpecializationChargeModuleCategory";

CREATE TABLE IF NOT EXISTS public."DoctorSpecializationChargeModuleCategory"
(
    "DoctorSpecializationChargeModuleCategoryId" integer NOT NULL DEFAULT nextval('"DoctorSpecializationChargeModuleCategory_DoctorSpecializationChargeModuleCategoryId_seq"'::regclass),
    "Active" boolean DEFAULT true,
    "ChargeTypesId" integer,
    "ModulesMasterId" integer,
    "ChargeModuleTemplateId" integer,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp without time zone,
    CONSTRAINT "DoctorSpecializationChargeModuleCategory_pkey" PRIMARY KEY ("DoctorSpecializationChargeModuleCategoryId"),
    CONSTRAINT "DoctorSpecializationChargeModuleCategory_ChargeTypesId_fkey" FOREIGN KEY ("ChargeTypesId")
        REFERENCES public."ChargeTypes" ("ChargeTypesId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleCategory_ChargeModuleTemplateId_fkey" FOREIGN KEY ("ChargeModuleTemplateId")
        REFERENCES public."ChargeModuleTemplate" ("ChargeModuleTemplateId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleCategory_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleCategory_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleCategory_ModulesMasterId_fkey" FOREIGN KEY ("ModulesMasterId")
        REFERENCES public."ModulesMaster" ("ModulesMasterId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public."DoctorSpecializationChargeModuleCategory"
    OWNER to postgres;

-----------------------------------------------------------------------------------------------------------------------------------------------------

create sequence "DoctorSpecializationChargeModuleDetails_DoctorSpecializationChargeModuleDetailsId_seq"

-----------------------------------------------------------------------------------------------------------------------------------------------------

-- Table: public.DoctorSpecializationChargeModuleDetails

-- DROP TABLE IF EXISTS public."DoctorSpecializationChargeModuleDetails";

CREATE TABLE IF NOT EXISTS public."DoctorSpecializationChargeModuleDetails"
(
    "DoctorSpecializationChargeModuleDetailsId" bigint NOT NULL DEFAULT nextval('"DoctorSpecializationChargeModuleDetails_DoctorSpecializationChargeModuleDetailsId_seq"'::regclass),
    "SpecializationId" integer NOT NULL,
    "ConsultationTypeId" integer NOT NULL,
    "ProviderId" integer,
    "DoctorSpecializationChargeModuleCategoryId" integer,
    "Amount" numeric(10,2),
    "LocationId" integer,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp without time zone,
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_pkey" PRIMARY KEY ("DoctorSpecializationChargeModuleDetailsId"),
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_DoctorSpecializationChargeModuleCategoryId_fkey" FOREIGN KEY ("DoctorSpecializationChargeModuleCategoryId")
        REFERENCES public."DoctorSpecializationChargeModuleCategory" ("DoctorSpecializationChargeModuleCategoryId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_SpecializationId_fkey" FOREIGN KEY ("SpecializationId")
        REFERENCES public."Specialization" ("SpecializationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_ConsultationTypeId_fkey" FOREIGN KEY ("ConsultationTypeId")
        REFERENCES public."ConsultationType" ("ConsultationTypeId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_ProviderId_fkey" FOREIGN KEY ("ProviderId")
        REFERENCES public."Provider" ("ProviderId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "DoctorSpecializationChargeModuleDetails_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public."DoctorSpecializationChargeModuleDetails"
    OWNER to postgres;
    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
